package com.feedback.b;

import android.content.Context;
import com.mobclick.android.t;
import java.util.Date;
import org.json.JSONException;
import org.json.JSONObject;

public class b
{
  /**
   * @deprecated
   */
  public static JSONObject a(Context paramContext, String paramString, int paramInt1, int paramInt2)
  {
    JSONObject localJSONObject1;
    monitorenter;
    try
    {
      localJSONObject1 = t.f(paramContext);
    }
    finally
    {
      JSONObject localJSONObject2;
      try
      {
        localJSONObject1.put("user_id", localJSONObject1.getString("idmd5"));
        localJSONObject1.put("thread", paramString);
        localJSONObject1.put("content", "Not supported on client yet");
        localJSONObject1.put("datetime", t.a(new Date()));
        localJSONObject1.put("feedback_id", d.a("FB", localJSONObject1.getString("appkey"), localJSONObject1.getString("user_id")));
        localJSONObject1.put("type", "new_feedback");
        localJSONObject2 = new JSONObject();
        localJSONObject2.put("age_group", paramInt1);
        switch (paramInt2)
        {
        default:
          localJSONObject1.put("userinfo", localJSONObject2);
          monitorexit;
          return localJSONObject1;
        case 1:
          localJSONObject2.put("gender", "male");
        case 2:
        }
      }
      catch (JSONException localJSONException)
      {
        while (true)
          localJSONException.printStackTrace();
        localObject = finally;
        monitorexit;
        throw localObject;
        localJSONObject2.put("gender", "female");
      }
    }
  }

  /**
   * @deprecated
   */
  public static JSONObject a(Context paramContext, String paramString1, String paramString2)
  {
    String str1;
    String str2;
    JSONObject localJSONObject;
    monitorenter;
    try
    {
      str1 = t.b(paramContext);
      localJSONObject = new JSONObject();
    }
    finally
    {
      try
      {
        localJSONObject.put("type", "user_reply");
        localJSONObject.put("appkey", str1);
        localJSONObject.put("content", paramString1);
        localJSONObject.put("user_id", str2);
        localJSONObject.put("datetime", t.a(new Date()));
        localJSONObject.put("feedback_id", paramString2);
        localJSONObject.put("reply_id", d.a());
        monitorexit;
        return localJSONObject;
      }
      catch (JSONException localJSONException)
      {
        while (true)
          localJSONException.printStackTrace();
        localObject = finally;
        monitorexit;
        throw localObject;
      }
    }
  }

  public static boolean a(JSONObject paramJSONObject)
  {
    int i;
    if (paramJSONObject == null)
    {
      i = 0;
      return i;
    }
    try
    {
      if (paramJSONObject.has("state"))
      {
        boolean bool = "ok".equals(paramJSONObject.getString("state"));
        if (bool)
          i = 1;
      }
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
      i = 0;
    }
  }

  /**
   * @deprecated
   */
  // ERROR //
  public static boolean a(JSONObject paramJSONObject, String paramString1, String paramString2)
  {
    // Byte code:
    //   0: ldc 2
    //   2: monitorenter
    //   3: aload_0
    //   4: aload_1
    //   5: aload_2
    //   6: invokevirtual 32	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   9: pop
    //   10: iconst_1
    //   11: istore 5
    //   13: ldc 2
    //   15: monitorexit
    //   16: iload 5
    //   18: ireturn
    //   19: astore 4
    //   21: aload 4
    //   23: invokevirtual 76	org/json/JSONException:printStackTrace	()V
    //   26: iconst_0
    //   27: istore 5
    //   29: goto -16 -> 13
    //   32: astore_3
    //   33: ldc 2
    //   35: monitorexit
    //   36: aload_3
    //   37: athrow
    //
    // Exception table:
    //   from	to	target	type
    //   3	10	19	org/json/JSONException
    //   3	10	32	finally
    //   21	26	32	finally
  }

  /**
   * @deprecated
   */
  // ERROR //
  public static boolean b(JSONObject paramJSONObject)
  {
    // Byte code:
    //   0: ldc 2
    //   2: monitorenter
    //   3: aload_0
    //   4: ldc 98
    //   6: invokevirtual 102	org/json/JSONObject:has	(Ljava/lang/String;)Z
    //   9: ifeq +17 -> 26
    //   12: aload_0
    //   13: ldc 98
    //   15: invokevirtual 116	org/json/JSONObject:remove	(Ljava/lang/String;)Ljava/lang/Object;
    //   18: pop
    //   19: iconst_1
    //   20: istore_2
    //   21: ldc 2
    //   23: monitorexit
    //   24: iload_2
    //   25: ireturn
    //   26: iconst_0
    //   27: istore_2
    //   28: goto -7 -> 21
    //   31: astore_1
    //   32: ldc 2
    //   34: monitorexit
    //   35: aload_1
    //   36: athrow
    //
    // Exception table:
    //   from	to	target	type
    //   3	19	31	finally
  }

  /**
   * @deprecated
   */
  public static boolean c(JSONObject paramJSONObject)
  {
    monitorenter;
    try
    {
      boolean bool = a(paramJSONObject, "state", "fail");
      monitorexit;
      return bool;
    }
    finally
    {
      localObject = finally;
      monitorexit;
      throw localObject;
    }
  }

  /**
   * @deprecated
   */
  public static boolean d(JSONObject paramJSONObject)
  {
    monitorenter;
    try
    {
      boolean bool = a(paramJSONObject, "state", "sending");
      monitorexit;
      return bool;
    }
    finally
    {
      localObject = finally;
      monitorexit;
      throw localObject;
    }
  }

  /**
   * @deprecated
   */
  public static boolean e(JSONObject paramJSONObject)
  {
    monitorenter;
    try
    {
      boolean bool = a(paramJSONObject, "state", "ok");
      monitorexit;
      return bool;
    }
    finally
    {
      localObject = finally;
      monitorexit;
      throw localObject;
    }
  }
}